import java.util.Vector;

import sdljava.SDLException;
import sdljava.video.SDLRect;
import sdljava.video.SDLSurface;
import sdljava.video.SDLVideo;
import sdljava.x.swig.SWIG_SDLVideoConstants;

public class Image {
	protected GameWindow gameWindow;
	protected Vector<SDLRect> images;
	
	public Image(GameWindow gameWindow){
		this.gameWindow = gameWindow;
	}
	
	public void show(SDLSurface image, int x, int y, SDLRect clip) throws SDLException{
		SDLRect offset = new SDLRect();
		
		offset.setX(x);
		offset.setY(y);
		
		image.blitSurface(clip, gameWindow.getGameSurface(), offset);
		gameWindow.getGameSurface().flip();
	}
	

	
	public void makeTransparent(SDLSurface surface) throws SDLException{
		long colorkey = SDLVideo.mapRGB(surface.getFormat(), 0xff, 0xff, 0xff);
		surface.setColorKey(SWIG_SDLVideoConstants.SDL_SRCCOLORKEY, colorkey);
	}
}
